package com.hq.fxh.No1_Infromation.Infor.Adapter;

import android.app.Activity;
import android.content.Context;
import android.view.View;

import com.hq.fxh.R;
import com.hq.fxh.Utils.LogUtils;
import com.hq.fxh.CustomerView.PopupWindow.PopupWindow_PingBi;

/**
 * /**
 *
 * @author 薛
 * @ClassName
 * @Description :
 * @Created 2017/8/9
 * @Email xlwenhao1858@sina.com
 */


class Help_Infor_NewsType3 {
    Context context;
    Adapter_recycle_infor.NewsType3ViewHolder holder;


    public Help_Infor_NewsType3(Context mcontext, Adapter_recycle_infor.NewsType3ViewHolder mholder ) {
        context = mcontext;
        holder = mholder;


    }

    public void doForNewsType3(int type) {
        if (type == -1) {
            LogUtils.e("newsType3中初始化type失败");
        } else if (type == 1) {
            /*新闻类型为新闻流*/
            holder.newsType3LinyoutAD.setVisibility(View.GONE);
            holder.newsType3LinyoutNoAD.setVisibility(View.VISIBLE);
            holder.NewsType3LinyoutCopyRight.setVisibility(View.VISIBLE);
            holder.NewsType3LinyoutAuthor.setVisibility(View.GONE);
            holder.news_author_tag.setVisibility(View.GONE);

        } else if (type == 2) {
             /*新闻类型为论坛新闻*/
            holder.newsType3LinyoutAD.setVisibility(View.GONE);
            holder.newsType3LinyoutNoAD.setVisibility(View.VISIBLE);
            holder.NewsType3LinyoutCopyRight.setVisibility(View.GONE);
            holder.NewsType3LinyoutAuthor.setVisibility(View.VISIBLE);
            holder.news_author_tag.setVisibility(View.VISIBLE);

        } else if (type == 3) {
             /*新闻类型为广告*/
            holder.newsType3LinyoutAD.setVisibility(View.VISIBLE);
            holder.newsType3LinyoutNoAD.setVisibility(View.GONE);

        } else {
            LogUtils.e("newsType3中type值异常");
        }

        holder.pingbi.setOnClickListener(new View.OnClickListener() {


            @Override
            public void onClick(View view) {
                View popview = View.inflate(context, R.layout.popup_information_pingbi, null);
                PopupWindow_PingBi popupWindow_pingBi = new PopupWindow_PingBi();
                popupWindow_pingBi.showPopupWindow((Activity) context, popview, holder.news_author_tag);


            }

        });
    }
}
